home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Palettes.h < prev    next >
Text File  |  1991-04-17  |  5KB  |  148 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, January 8, 1991 at 9:43 AM
  4.     Palettes.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1987-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __PALETTES__
  15. #define __PALETTES__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #ifndef __WINDOWS__
  22. #include <Windows.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.     pmCourteous = 0,        /*Record use of color on each device touched.*/
  29.     pmTolerant = 0x0002,    /*render ciRGB if ciTolerance is exceeded by best match.*/
  30.     pmAnimated = 0x0004,    /*reserve an index on each device touched and render ciRGB.*/
  31.     pmExplicit = 0x0008,    /*no reserve, no render, no record; stuff index into port.*/
  32.  
  33.     pmWhite = 0x0010,
  34.     pmBlack = 0x0020,
  35.  
  36.     pmInhibitG2 = 0x0100,
  37.     pmInhibitC2 = 0x0200,
  38.     pmInhibitG4 = 0x0400,
  39.     pmInhibitC4 = 0x0800,
  40.     pmInhibitG8 = 0x1000,
  41.     pmInhibitC8 = 0x2000,
  42.  
  43.  
  44. /* NSetPalette Update Constants */
  45.     pmNoUpdates = 0x8000,   /*no updates*/
  46.     pmBkUpdates = 0xA000,   /*background updates only*/
  47.     pmFgUpdates = 0xC000,   /*foreground updates only*/
  48.     pmAllUpdates = 0xE000   /*all updates*/
  49. };
  50.  
  51. struct ColorInfo {
  52.     RGBColor ciRGB;         /*true RGB values*/
  53.     short ciUsage;          /*color usage*/
  54.     short ciTolerance;      /*tolerance value*/
  55.     short ciDataFields[3];  /*private fields*/
  56. };
  57.  
  58. typedef struct ColorInfo ColorInfo;
  59.  
  60. struct Palette {
  61.     short pmEntries;        /*entries in pmTable*/
  62.     short pmDataFields[7];  /*private fields*/
  63.     ColorInfo pmInfo[1];
  64. };
  65.  
  66. typedef struct Palette Palette;
  67. typedef Palette *PalettePtr, **PaletteHandle;
  68.  
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. pascal void InitPalettes(void)
  74.     = 0xAA90; 
  75. pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
  76.     short srcTolerance)
  77.     = 0xAA91; 
  78. pascal PaletteHandle GetNewPalette(short PaletteID)
  79.     = 0xAA92; 
  80. pascal void DisposePalette(PaletteHandle srcPalette)
  81.     = 0xAA93; 
  82. pascal void ActivatePalette(WindowPtr srcWindow)
  83.     = 0xAA94; 
  84. pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
  85.     = 0xAA95; 
  86. pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
  87.     = 0xAA95; 
  88. pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  89.     = 0xAA96; 
  90. pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
  91.     short srcEntry,short dstEntry,short dstLength)
  92.     = 0xAAA1; 
  93. pascal void PmForeColor(short dstEntry)
  94.     = 0xAA97; 
  95. pascal void PmBackColor(short dstEntry)
  96.     = 0xAA98; 
  97. pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor *srcRGB)
  98.     = 0xAA99; 
  99. pascal void AnimatePalette(WindowPtr dstWindow,CTabHandle srcCTab,short srcIndex,
  100.     short dstEntry,short dstLength)
  101.     = 0xAA9A; 
  102. pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor *dstRGB)
  103.     = 0xAA9B; 
  104. pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor *srcRGB)
  105.     = 0xAA9C; 
  106. pascal void GetEntryUsage(PaletteHandle srcPalette,short srcEntry,short *dstUsage,
  107.     short *dstTolerance)
  108.     = 0xAA9D; 
  109. pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
  110.     short srcTolerance)
  111.     = 0xAA9E; 
  112. pascal void CTab2Palette(CTabHandle srcCTab,PaletteHandle dstPalette,short srcUsage,
  113.     short srcTolerance)
  114.     = 0xAA9F; 
  115. pascal void Palette2CTab(PaletteHandle srcPalette,CTabHandle dstCTab)
  116.     = 0xAAA0; 
  117. pascal long Entry2Index(short entry)
  118.     = {0x7000,0xAAA2}; 
  119. pascal void RestoreDeviceClut(GDHandle gd)
  120.     = {0x7002,0xAAA2}; 
  121. pascal void ResizePalette(PaletteHandle p,short size)
  122.     = {0x7003,0xAAA2}; 
  123. pascal void SaveFore(ColorSpec *c)
  124.     = {0x303C,0x040D,0xAAA2}; 
  125. pascal void SaveBack(ColorSpec *c)
  126.     = {0x303C,0x040E,0xAAA2}; 
  127. pascal void RestoreFore(const ColorSpec *c)
  128.     = {0x303C,0x040F,0xAAA2}; 
  129. pascal void RestoreBack(const ColorSpec *c)
  130.     = {0x303C,0x0410,0xAAA2}; 
  131. pascal OSErr SetDepth(GDHandle gd,short depth,short whichFlags,short flags)
  132.     = {0x303C,0x0A13,0xAAA2}; 
  133. pascal short HasDepth(GDHandle gd,short depth,short whichFlags,short flags)
  134.     = {0x303C,0x0A14,0xAAA2}; 
  135. pascal short PMgrVersion(void)
  136.     = {0x7015,0xAAA2}; 
  137. pascal void SetPaletteUpdates(PaletteHandle p,short updates)
  138.     = {0x303C,0x0616,0xAAA2}; 
  139. pascal short GetPaletteUpdates(PaletteHandle p)
  140.     = {0x303C,0x0417,0xAAA2}; 
  141. pascal Boolean GetGray(GDHandle device,const RGBColor *backGround,RGBColor *foreGround)
  142.     = {0x303C,0x1219,0xAAA2}; 
  143. #ifdef __cplusplus
  144. }
  145. #endif
  146.  
  147. #endif
  148.